home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / elk-2_0.lha / elk-2.0 / contrib / zelk / Doc / changes-from-2.0.txt next >
Encoding:
Text File  |  1992-11-13  |  4.8 KB  |  179 lines

  1. This file is a description of the changes made in the Elk2.0 kernel.
  2.  
  3. The following files are changed:
  4. object.h, 
  5. load.c, main.c, proc.c, stab.c, type.c, math.c, 
  6.  
  7. BEWARE - The installation copies over these files in src/,
  8. and scm/toplevel!
  9.  
  10. Also note that the diff listings below are with respect to
  11. the Oct15/92 pre-release of elk2.0.
  12.  
  13. config/system================
  14.  
  15. The optional vector math file fvector.c must be compiled with an 
  16. ANSI compiler.  In the sun/cc version of config/system, config/zelk
  17. nevertheless tries to use gcc to compile this file.  
  18. Since gcc aligns on 8, the alignment in the sun/cc file is set to 8
  19. (otherwise calling fvector is not possible).
  20. One of the gcc authors told me that code runs faster on the sun
  21. when aligned on 8 in any case.
  22.  
  23. Object.h================================
  24. In the primitive structure add a new pointer which if non-null
  25. points to a foreign function argument description string;
  26. add new discipline FOREIGN:
  27. 127c127,131
  28. < enum discipline { EVAL, NOEVAL, VARARGS };
  29. ---
  30. > #if ZELK
  31. >  enum discipline { EVAL, NOEVAL, VARARGS, FOREIGN };
  32. > #else
  33. >  enum discipline { EVAL, NOEVAL, VARARGS };
  34. > #endif
  35. 134a139,141
  36. > #if ZELK
  37. >     unsigned char *forfunargs;  /* foreign function arguments */
  38. > #endif
  39.  
  40.  
  41. proc.c================================
  42. If the discipline is FOREIGN, call ZLforcall, passing everything
  43. and the new forfunargs string.
  44. 4a5,7
  45. > #if ZELK
  46. > # include <zelk.h>
  47. > #endif
  48. 222c225,232
  49. <     } else {
  50. ---
  51. >     }
  52. > # ifdef ZELK 
  53. >         else if (prim->disc == FOREIGN) {
  54. >             ret = ZLforcall(prim->name,(function *)prim->fun,prim->forfunargs,
  55. >                             argc,argv);
  56. >         }
  57. > # endif
  58. >         else {
  59.  
  60.  
  61. main.c================================
  62. in Init_Everything(), add a call to initialize the extensions last:
  63. 1a2
  64. > #include <zelk.h>
  65. 204a206,208
  66. > #endif
  67. > #if ZELK
  68. >     Init_Zelk ();
  69.  
  70.  
  71. type.c================================
  72. The foreign function argument specification uses T_Fixnum, etc
  73. (primitive->forfunargs is an array of T_codes).
  74. T_Returns is a new meta code indicating that the following T_code
  75. is the return type of the foreign function; T_End is a meta code
  76. indicating the end of the foreign function argument specification.
  77. T_Returns and T_End are allocated at the top of the type range- 254,255.
  78. The foreign function interface on the sgi also uses a code T_Double
  79. with the value 253.
  80. This change checks that Elk allocated types do not overrun 
  81. our meta-codes:
  82. 1a2,4
  83. > #if ZELK
  84. > # include <zelk.h>
  85. > #endif
  86. 78a82,91
  87. > #if ZELK
  88. >     /* the foreign function argspec uses 8bit ids, with 253,254,255
  89. >      * used as meta-codes such as T_Returns and T_End.
  90. >      * if more than 253 types, must extend the argspec to 16bits
  91. >      */
  92. >     if (t >= 253)
  93. >       Panic("type id > 253: extend foreign types > 8bits");
  94. > #endif
  95.  
  96.  
  97. stab.c================================
  98. Call_Initializers() looks for and calls init_XX routines in .o files.
  99. Modify this so that it also calls routines named PKGrtn_XX(),
  100. and passes the result on to Zforpkginit().
  101. The rationale for this is described in the tutorial.
  102. 4a5,7
  103. > #if ZELK
  104. > # include <zelk.h>
  105. > #endif
  106. 89c92,110
  107. <     }
  108. ---
  109. >         }
  110. > #ifdef ZELK
  111. > # ifdef SYMS_UNDERL
  112. > #  define FORLIB "_PKGrtn_"
  113. > #  define FORLEN 8
  114. > # else
  115. > #  define FORLIB "PKGrtn_"
  116. > #  define FORLEN 7
  117. > # endif
  118. >         /* load foreign libraries */
  119. >         if (strncmp(sp->name,FORLIB,FORLEN)==0) {
  120. >             PKG_type *pkgtab;
  121. >             /*printf("got forlib symbol :%s:\n",sp->name);*/
  122. >             pkgtab = (PKG_type *) ( (GENERIC (*)()) sp->value )();
  123. >             Zforpkginit(sp->name+FORLEN,pkgtab);
  124. >             got_one = 1;
  125. >         }
  126. > #endif /*ZELK*/
  127. 91c112
  128. <     }
  129. ---
  130. >       }
  131.  
  132. load.c================================
  133. Make these variables global - they are used in forpkg.c.
  134.    /*static*/ Object V_Load_Path, V_Load_Noisilyp, V_Load_Libraries;
  135.  
  136.  
  137. math.c================================
  138. This change is not part of the foreign function interface.
  139. 1a2,12
  140. >  * modified (zilla)
  141. >  * Elk math has several characteristics which are altered
  142. >  * as follows:
  143. >  *- (/ x y) when both x,y are integer is treated as if x,y are both
  144. >  *  real, e.g. (/ 5 3) => 1.6666.  Xscheme and Scm also act this way;
  145. >  *  vscm has (/ 5 3) => 1 (integer).
  146. >  *  ZELK_INTEGER_DIV changed this so that (/ 5 3) => 1 (as in C).
  147. >  *
  148. >  *- Real numbers equal to integers become integers, 
  149. >  *  e.g. (/ 6. 3.) => 2 (integer); (type 2.0) => integer
  150. >  *  ZELK_CONTAGIOUS_FLT makes floats 'contagious'.
  151. 7a19,20
  152. > #include <zelk.h>
  153. 121a135
  154. > #if (!ZELK_CONTAGIOUS_FLT)
  155. 128a143
  156. > #endif
  157. 477a493,495
  158. > # if ZELK_INTEGER_DIV
  159. >             return Make_Integer( FIXNUM(x) / FIXNUM(y) );
  160. > # else
  161. 478a497
  162. > # endif
  163. 507a527,529
  164. > # if ZELK_INTEGER_DIV
  165. >             return Car(ret);
  166. > # else
  167. 509a532
  168. > # endif
  169. 517a541,543
  170. > # if ZELK_INTEGER_DIV
  171. >             return Car(ret);
  172. > # else 
  173. 519a546
  174. > # endif
  175.